<?php

require_once("Database.php");
require_once("DBConfig.php");
require_once("LoginController.php");
require_once("LoginView.php");
require_once("LoginHandler.php");
require_once("PageView.php");

class MasterController {
	
	public static function do_control() {
		
		// Upprätta databasanslutning
		$db = new Database();
		$db->connect(new DBConfig());
		
		// Kör controllers
		$login_controller = new LoginController();
		$login_view = new LoginView();
		
		$html = $login_controller->do_control($db, $login_view);
		
		// Stäng databasanslutning
		$db->close();
		
		// Generera HTML
		$page_view = new PageView();
		
		return $page_view->html5("1DV408 - Labb 2", $html);
		
	}
	
}

echo MasterController::do_control();

?>